include_guard(GLOBAL)
macro(set_problem_type type)
    add_custom_target(
            ConstraintsHeader ALL
            COMMAND python3 ${HeadersScriptPath}/CustomConstraints.py ${CMAKE_CURRENT_BINARY_DIR}
            ${type}
            COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/Generated
            COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/Constraints.h
            ${CMAKE_CURRENT_BINARY_DIR}/Generated/Constraints.h
            COMMENT "Generating Constraints.h"
    )

    add_custom_target(
            InstanceHeader ALL
            COMMAND python3 ${HeadersScriptPath}/CustomInstance.py ${CMAKE_CURRENT_BINARY_DIR}
            ${type}
            COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/Instance.h
            ${CMAKE_CURRENT_BINARY_DIR}/Generated/Instance.h
            COMMENT "Generating Instance.h"
    )

    set(all_problem_type MDVRP LRP MDOVRP GVRP MDGVRP)
    string(FIND ${type} "_" index)
    string(SUBSTRING ${type} 0 ${index} realType)
    message(${realType})
    addMacroDefinition(TARGET BasicHeadersOfRoutesRelatedProblemsLib
            MacroName ${realType}
            Scope INTERFACE
            Comment "problem type is ${type}"
            OptionHint "Problem Type ${realType} should be one of MDVRP, LRP, MDOVRP, GVRP, MDGVRP"
            Options all_problem_type)

    target_include_directories(BasicHeadersOfRoutesRelatedProblemsLib INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/Generated)

    add_dependencies(BasicHeadersOfRoutesRelatedProblemsLib ConstraintsHeader InstanceHeader)
endmacro()
